exports.searchTeamMemberList = (req,res) => {

    var restfulParams = req.routeInfo.restfulParams;

    var resultData = [];

    //获取团队成员信息
    function searchTeamMember(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url: CORE_APIConfig.coreAPI.userSearch.Request_Api_Url + "/u_master_osid/" + restfulParams.u_master_osid + "/u_type/" +restfulParams.u_type+ "/u_is_delete/0/skip/0/limit/1000",
                method : 'POST',
                data   : {
                    fields : "u_id,u_nickname,u_phone,u_create_time,u_is_activation,u_master_osid"
                }
            },
            function (data) {

                resultData = data.result;

                cb();
                
            }
        )
    }

    //获取用户级别
    function searchMembersLevel(cb){

        for(var i=0;i<resultData.data.length;i++){
            resultData.data[i].level = "组员";
        }

        cb();
    }

    //获取成交客户数
    function searchCustomCount(cb){

        for(var i=0;i<resultData.data.length;i++){
            resultData.data[i].customCount = 0;
        }

        cb();
    }

    //获取销售金额
    function searchBuyMoney(cb){

        for(var i=0;i<resultData.data.length;i++){
            resultData.data[i].money = 0;
        }

        cb();
    }

    F.Serial([searchTeamMember,searchMembersLevel,searchCustomCount,searchBuyMoney],() => {
        RES.successResponse(res,resultData);
    })

}